package edu.gyc.objecthomework;/*
 * ScienceFairProjectRating.java
 *
 * Created on February 15, 2007, 4:09 PM
 *
 * Solution to Exercise 10
 */

/**
 *
 * @author charleshoot
 */

import java.util.Scanner;

public class ScienceFairProjectRating {
    
    
    
    
    private String projectName;
    private String identifier;
    private String submitter;
    private RatingScore creativeRating;
    private RatingScore thoughtRating;
    private RatingScore thoroughnessRating;
    private RatingScore technicalRating;
    private RatingScore clarityRating;
    
    
    
    public void initialize(String name, String id, String person) {
        projectName = name;
        identifier = id;
        submitter = person;
        creativeRating = new RatingScore();
        thoughtRating= new RatingScore();
        thoroughnessRating= new RatingScore();
        technicalRating= new RatingScore();
        clarityRating= new RatingScore();
        creativeRating.initialize("How creative was this project", 30);
        thoughtRating.initialize("Was scientific thought displayed in the project", 30);
        thoroughnessRating.initialize("Did the project cover the material thoroughly", 15);
        technicalRating.initialize("Were appropriate technical skill displayed", 15);
        clarityRating.initialize("Was the presentation of the project clear", 10);
    }
    
    
    
    
    public void rateProject(){
        System.out.println("Please enter ratings for the project " + projectName
                + "(" + identifier + ")");
        
        creativeRating.inputRating();
        thoughtRating.inputRating();
        thoroughnessRating.inputRating();
        technicalRating.inputRating();
        clarityRating.inputRating();
    }
    
    public int totalRating(){
        return creativeRating.getRating()+
                thoughtRating.getRating()+
                thoroughnessRating.getRating()+
                technicalRating.getRating()+
                clarityRating.getRating();
    }
    
    public int maxRating(){
        return creativeRating.getMaxRating()+
                thoughtRating.getMaxRating()+
                thoroughnessRating.getMaxRating()+
                technicalRating.getMaxRating()+
                clarityRating.getMaxRating();    }
    
    public String getRatingString(){
        return "Project " + projectName + "("+ identifier + ") by " + submitter + " was given the score " + totalRating() + "/" + maxRating();
    }
    
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        ScienceFairProjectRating joesProject = new ScienceFairProjectRating();
        ScienceFairProjectRating suesProject = new ScienceFairProjectRating();
         joesProject.initialize("Weather and You", "U1256", "Joe Minnow");
         suesProject.initialize("Hot Air", "U1275", "Susan Shark");
        
        joesProject.rateProject();
        suesProject.rateProject();
        System.out.println("Judging is completed: ");
        System.out.println(joesProject.getRatingString());
        System.out.println(suesProject.getRatingString());
        
    }
    
}


